<template>
  <a-card :bordered='false'>
    <div class='table-page-search-wrapper'>
      <a-form layout='inline' @keyup.enter.native='getData'>
        <a-row :gutter='24'>
          <a-col :xl='6' :lg='7' :md='8' :sm='24'>
            <a-form-item label='错误编号'>
              <a-input placeholder='错误编号' v-model='queryParam.code'></a-input>
            </a-form-item>
          </a-col>
          <div style='float: left;overflow: hidden;' class='table-page-search-submitButtons'>
            <a-col :xl='6' :lg='7' :md='8' :sm='24'>
              <a-button type='primary' @click='getData' icon='search'>查询</a-button>
              <a-button type='primary' @click='searchReset' icon='reload' style='margin-left: 8px'>重置</a-button>
<!--              <a @click='handleToggleSearch' style='margin-left: 8px'>-->
<!--                {{ toggleSearchStatus ? '收起' : '展开' }}-->
<!--                <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />-->
<!--              </a>-->
            </a-col>
          </div>
        </a-row>
      </a-form>
    </div>
<!--    <JEditor :value='result.msg' />-->
    <div v-html='result.msg' class='editor'></div>
  </a-card>

</template>

<script>
import { PageListMixin } from '@/mixins/PageListMixin'
import { getAction, postAction, deleteAction } from '@api/manage'
import JEditor from '@/components/cn-form/JEditor.vue'

export default {
  name: 'errorLog',
  mixins: [PageListMixin],
  components: {
    JEditor
  },
  data() {
    return {
      description: '错误日志',
      disableMixinCreated: true,
      labelCol: {
        xs: { span: 24 },
        sm: { span: 3 }
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 16 }
      },
      result: {
        msg: ''
      },
      url: {
        list: window._CONFIG['domianURL'] + '/registryController/errorDetail'
      }
    }
  },
  created() {
  },
  computed: {},
  methods: {

    searchReset() {
      this.queryParam = {}
      this.result = { msg: '' }
    },
    getData() {
      let params = this.queryParam
      if (!params.code) return
      getAction(this.url.list, params).then(res => {
        if (res.success) {
          if (res.result) {
            // this.result=res.result
            this.$set(this, 'result', res.result)
          }else {
            this.$set(this, 'result', '')
          }
        } else {
          this.$message.error(res.message)
        }
      })
    }

  }
}
</script>

<style scoped>
@import '~@assets/less/common.less';
.editor{
  padding: 12px;
  background-color: #fff;
  border: 1px solid #D9D9D9;
  height: calc(100vh - 146px);
  box-sizing: border-box;
  overflow-y: scroll;
}
</style>